<?php 
// back page
include_once("../UserIncludes/DbConfig.php");
include_once("../UserIncludes/DataTables.php");

$str="";
if($_REQUEST['adgroup_ad_runn']=='N')
{
	$update_run_adgroup_ad="update adgroup_ad set runn = 'Y' where adgroup_ad_id = '".$_REQUEST['adgroup_ad_id']."'";
	//$str .="Running".":".$_REQUEST['adgroup_ad_count_col'];
	$str .="Running".":".$_REQUEST['adcamp_count_col'].":".$_REQUEST['adgroup_count_col'].":".$_REQUEST['adgroup_ad_count_col'];
}
else
{
	$update_run_adgroup_ad="update adgroup_ad set runn = 'N' where adgroup_ad_id = '".$_REQUEST['adgroup_ad_id']."'";
	//$str .="Paused".":".$_REQUEST['adgroup_ad_count_col'];
	$str .="Paused".":".$_REQUEST['adcamp_count_col'].":".$_REQUEST['adgroup_count_col'].":".$_REQUEST['adgroup_ad_count_col'];
}
mysql_query($update_run_adgroup_ad);

$SQL_action_adgroup_ad = "select * from adgroup_ad where adgroup_ad_id = '".$_REQUEST['adgroup_ad_id']."'";
//echo $SQL_action;
$EXE_action_adgroup_ad=mysql_query($SQL_action_adgroup_ad);
$ROW_action_adgroup_ad=mysql_fetch_array($EXE_action_adgroup_ad);

$str .=":";
if($ROW_action_adgroup_ad['runn']=='N')
{
	$str .= '<img src="images/icon-status-running.gif" align="middle" onclick="change_status_adgroup_ad('.$_REQUEST['adgroup_ad_id'].',\''.$ROW_action_adgroup_ad['runn'].'\','.$_REQUEST['adcamp_count_col'].','.$_REQUEST['adgroup_count_col'].','.$_REQUEST['adgroup_ad_count_col'].');">';

}
else
{
	$str .= '<img src="images/icon-status-paused.gif" align="middle" onclick="change_status_adgroup_ad('.$_REQUEST['adgroup_ad_id'].',\''.$ROW_action_adgroup_ad['runn'].'\','.$_REQUEST['adcamp_count_col'].','.$_REQUEST['adgroup_count_col'].','.$_REQUEST['adgroup_ad_count_col'].');">';

}

echo $str."^8";
//echo "^6";
?>
